package com.msmall.community.diary.service;

import java.util.List;

import com.msmall.base.pager.PaginationSupport;
import com.msmall.base.service.BaseManager;
import com.msmall.community.common.util.FilterCharsUtil;
import com.msmall.community.diary.model.Diary;
import com.msmall.community.diary.model.DiaryReply;
import com.msmall.community.diary.vo.DiaryReplyVO;
import com.msmall.community.question.util.QuestionUtil;

public interface DiaryManager extends BaseManager{

	/**
	 * 用户创建日记
	 */
	public Diary saveDiary(Diary diary, Long userid, String uat) throws Exception;
	
	/**
	 * 删除日记
	 */
	public void removeDiary(Long albumid, Long userid) throws Exception;
	
	/**
	 * 分页显示日记列表
	 */
	public void diaryList(PaginationSupport page, Long userid) throws Exception;
	
	/**
	 * 通过id查找日记
	 */
	public Diary getDiaryByid(Long diaryid) throws Exception;
	
	/**
	 * 通过id查找日记的前一张日记,按ID排序，如果是第一张，跳到最后一张
	 */
	public Diary getDiaryPreByid(Long diaryid) throws Exception;
	/**
	 * 通过id查找照片的后一日记,按ID排序，如果是最后一张，跳到第一张
	 */
	public Diary getDiaryNextByid(Long diaryid) throws Exception;
	
	/**
	 * 获得日记的所有评论.盖楼效果
	 */
	public List<DiaryReplyVO> getReplysByDiaryid(Long diaryid, Short enabled)throws Exception;
	/**
	 * 验证Diary TITLE
	 * @return 1:正常；2字符太少；3字符太多;4含有非法字符
	 */
	public int validateDiaryTitle(String title);
	
	/**
	 * 验证Diary content
	 * @return 1:正常；2字符太少；3字符太多;4含有非法字符
	 */
	public int validateDiaryContent(String content);
	
	/**
	 * 同时增加日记评论回答数量
	 */
	public DiaryReply saveDiaryReply(DiaryReply reply, Long userid, String uat) throws Exception;
	/**
	 * 验证Diary.reply content
	 * @return 1:正常；2字符太少；3字符太多;4含有非法字符
	 */
	public int validateReplyContent(String content);
	
}
